package route

import (
	"chatgpt/controller/backend"
	"chatgpt/controller/middleware"
	"github.com/gin-gonic/gin"
)

func backendRouter(router *gin.Engine) {
	backr := router.Group("/backend", middleware.RawData())

	// 需要登陆验证的接口
	backr.Use(middleware.MustLogin())
	// product
	backr.Any("product/list", backend.ProductListHandle)
	backr.Any("product/save", backend.ProductSaveHandle)
	backr.Any("product/status", backend.ProductStatusHandle)

	// price
	backr.Any("price/list", backend.PriceBaseListHandle)
	backr.Any("price/active-list", backend.PriceActivityListHandle)
	backr.Any("price/save", backend.PriceSaveHandle)
	backr.Any("price/delete", backend.PriceDeleteHandle)

	// benefit
	backr.Any("benefit/list", backend.BenefitListHandle)
	backr.Any("benefit/save", backend.BenefitSaveHandle)
	backr.Any("benefit/delete", backend.BenefitDeleteHandle)
	backr.Any("benefit/scope-act", backend.BenefitScopeHandle)
	backr.Any("scope/save", backend.ScopeSaveHandle)
	backr.Any("scope/list", backend.ScopeListHandle)
	backr.Any("benefit/force", backend.BenefitForceHandle)

	//order

	// gofound 搜索引擎
	backr.Any("gofound/add-index", backend.AddIndexHandle)
	backr.Any("gofound/remove-index", backend.RemoveIndexHandle)
	backr.Any("gofound/query", backend.IndexQuery)

}
